#ifndef _AS_ENTITY_ATTRIBUTE_H_
#define _AS_ENTITY_ATTRIBUTE_H_

#include "ASCommon.h"

NS_AS_BEGIN

class ASEntityAttribute
{
public:
#define kASEntityAttributeEncrypt 0x19870911
	enum LimitTriggerEnum{
		LimitTrigger_NO,
		LimitTrigger_MIN,
		LimitTrigger_MAX,
	};
	ASEntityAttribute(unsigned int attrINum,unsigned int attrFNum=0,unsigned int encryptkey=kASEntityAttributeEncrypt);
	virtual ~ASEntityAttribute();
	ASEntityAttribute(const ASEntityAttribute& copy);
	ASEntityAttribute& operator=(const ASEntityAttribute& copy);

	void setAttrINum(unsigned int attrINum);
	void setAttrFNum(unsigned int attrFNum);
	void setEncryptKey(unsigned int encryptkey);

	int getAttributeI(unsigned int index);
	void setAttributeI(unsigned int index,int value);
	void changeAttributeI(unsigned int index,int value);
	LimitTriggerEnum changeAttributeI(unsigned int index,int value,int min,int max,int* pOutValue);
	bool checkAttributeValidI(unsigned int index);

	float getAttributeF(unsigned int index);
	void setAttributeF(unsigned int index,float value);
	void changeAttributeF(unsigned int index,float value);
	LimitTriggerEnum changeAttributeF(unsigned int index,float value,float min,float max,float* pOutValue);
	bool checkAttributeValidF(unsigned int index);
	bool checkAttributeValid();
private:
	int* _pAttrsI;
	float* _pAttrsF;
	int* _pAttrsSignI;
	float* _pAttrsSignF;
	unsigned int _nAttrINum;
	unsigned int _nAttrFNum;
	unsigned int _encryptkey;
};

NS_AS_END

#endif